/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;
import data.Departments;
import data.Deptposweightage;
import data.Designation;
import java.util.List;
import javax.swing.ComboBoxModel;
import util.BaseDAO;
import dao.DepartmentDAO;
import javax.swing.table.TableModel;
import tableview.DeptposweightageTable;

/**
 *
 * @author ChiHieu
 */
public class DeptposweightageDAO extends BaseDAO{
	 public Departments getDepartmentByName(String deptName) {
        String hql = "from Departments s where s.deptname = '"+ deptName+"'";
        List<Departments> ldept = executeHQLQuery(hql);
        if(ldept.size() == 0 )
        {
            return null;
        }
        return ldept.get(0);
    }
	 public List<Deptposweightage> getAll() {
        String hql = "from Deptposweightage";
        List<Deptposweightage> ldept = executeHQLQuery(hql);
        return ldept;
    }

	public TableModel ShowTableDeptposweightage() {
		return new DeptposweightageTable(getAll());
	}
	
	
	
}
